<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class Config_model extends CI_Model {
	public function __construct() {
		parent::__construct ();
	}
    /*
	 * 根据key查找配置
	 */
	public function find_by_key($key){
		$this->db->where('key', $key);
		$query = $this->db->get("t_config");
		return $query->row_array();
	}
	/*
	 *更新配置信息
	 */
	public function update($id,$config){
		$this->db->where('id', $id);
		$this->db->update('t_config', $config);
		return $this->db->affected_rows()>0;
	}
}
